package model

type StudentExam struct {
	ID              int64   `gorm:"primaryKey;autoIncrement;column:id;"json:"id"`
	TypeID          int64   `gorm:"not null;default:0;column:type_id;" json:"type_id"`
	ExamID          int64   `gorm:"not null;default:0;column:exam_id;" json:"exam_id"`
	RoomID          int64   `gorm:"not null;default:0;column:room_id;" json:"room_id"`
	StuID           int64   `gorm:"not null;default:0;column:stu_id;" json:"stu_id"`
	ExamType        int     `gorm:"not null;default:0;column:exam_type;"json:"exam_type"`
	ExamStatus      int     `gorm:"not null;default:0;column:exam_status;" json:"exam_status"`
	SeatNumber      int64   `gorm:"not null;default:0;column:seat_number;" json:"seat_number"`
	WriteScores     float32 `gorm:"not null;default:0;column:write_scores" json:"write_scores"`
	InterviewScores float32 `gorm:"not null;default:0;column:interview_scores;" json:"interview_scores"`
	TotalScores     float32 `gorm:"not null;default:0;column:total_scores;" json:"total_scores"`
	PlaybackURL     string  `gorm:"type:varchar(500);collate:utf8mb4_unicode_ci;not null;default:'';column:playback_url;" json:"playback_url"`
	PlaybackURL1    string  `gorm:"type:varchar(500);collate:utf8mb4_unicode_ci;not null;default:'';column:playback_url1;" json:"playback_url1"`
	AttachURL       string  `gorm:"type:varchar(255);collate:utf8mb4_unicode_ci;not null;column:attach_url;" json:"attach_url"`
	Status          int64   `gorm:"not null;default:0;column:status;" json:"status"`
	SubmitStatus    int64   `gorm:"not null;default:0;column:submit_status;" json:"submit_status"`
	CreatedAt       int64   `gorm:"not null;default:0;column:created_at;" json:"created_at"`
	UpdatedAt       int64   `gorm:"not null;default:0;column:updated_at;" json:"updated_at"`
	DeletedAt       int64   `gorm:"not null;default:0;column:deleted_at;" json:"deleted_at"`
	AnswerStatus    int64   `gorm:"not null;default:0;column:answer_status;" json:"answer_status"`
	SchoolID        int64   `gorm:"not null;default:0;column:school_id;" json:"school_id"`
	Year            int64   `gorm:"not null;default:0;column:year;" json:"year"`
	TimeID          int64   `gorm:"not null;default:0;column:time_id;"json:"time_id"`
	StuName         string  `gorm:"type:varchar(30);collate:utf8mb4_unicode_ci;not null;column:stu_name;" json:"stu_name"`
	RoomName        string  `gorm:"type:varchar(50);collate:utf8mb4_unicode_ci;not null;column:room_name;"json:"room_name"`
	Content         string  `gorm:"type:longtext;collate:utf8mb4_unicode_ci;column:content;" json:"content"`
	IsPrint         int     `gorm:"not null;column:is_print;" json:"is_print"`
	QuesContent     string  `gorm:"type:longtext;collate:utf8mb4_unicode_ci;column:ques_content;" json:"ques_content"`
	SubmitTime      int64   `gorm:"not null;default:0;column:submit_time;" json:"submit_time"`
	IsSyncScore     int     `gorm:"not null;default:1;unsigned;column:is_sync_score;" json:"is_sync_score"`
	IsSchedule      int     `gorm:"not null;default:0;column:is_schedule;" json:"is_schedule"`
}

func (StudentExam) TableName() string {
	return "fd_student_exam"
}

type StudentExamRoom struct {
	RoomID  int64             `json:"room_id"`
	TimeID  int64             `json:"time_id"`
	Room    JoinRoom          `json:"room" gorm:"foreignKey:id;references:room_id"`
	StuList []JoinStudentExam `json:"stuList" gorm:"foreignKey:room_id;references:room_id"`
}

func (StudentExamRoom) TableName() string {
	return "fd_student_exam"
}

type JoinStudentExam struct {
	ID         int64  `gorm:"primaryKey;autoIncrement;column:id;"json:"id"`
	RoomID     int64  `gorm:"not null;default:0;column:room_id;" json:"room_id"`
	StuID      int64  `gorm:"not null;default:0;column:stu_id;" json:"stu_id"`
	SeatNumber int64  `gorm:"not null;default:0;column:seat_number;" json:"seat_number"`
	TimeID     int64  `gorm:"not null;default:0;column:time_id;"json:"time_id"`
	StuName    string `gorm:"type:varchar(30);collate:utf8mb4_unicode_ci;not null;column:stu_name;" json:"stu_name"`
}

func (JoinStudentExam) TableName() string {
	return "fd_student_exam"
}
